#version 100
#ifdef GL_ES
precision highp float; 
#endif
varying vec4 V_Color;
varying vec2 V_TexCoord;
uniform sampler2D U_MainTexture;
void main()
{
	float kernel[9];
	kernel[0]=1.0;
	kernel[1]=1.0;
	kernel[2]=1.0;
	kernel[3]=1.0;
	kernel[4]=-10.0;
	kernel[5]=1.0;
	kernel[6]=1.0;
	kernel[7]=1.0;
	kernel[8]=1.0;
	
	float offset=1.0/100.0;
	vec2 offsets[9];
	offsets[0]=vec2(-offset,offset);
	offsets[1]=vec2(0,offset);
	offsets[2]=vec2(offset,offset);
	offsets[3]=vec2(-offset,0);
	offsets[4]=vec2(0,0);
	offsets[5]=vec2(offset,0);
	offsets[6]=vec2(-offset,-offset);
	offsets[7]=vec2(0,-offset);
	offsets[8]=vec2(offset,-offset);
	vec3 color=vec3(0);
	for(int i=0;i<9;i++)
	{
		color+=texture2D(U_MainTexture, V_TexCoord+offsets[i]).rgb*kernel[i];
	}
	vec4 outColor=vec4(color,texture2D(U_MainTexture, V_TexCoord).a);
	gl_FragColor = outColor*V_Color;
}